package org.sishoras.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.reservas.modelo.Reserva;
import org.sishoras.modelo.Adiantamento;
import org.sishoras.modelo.Aula;
import org.sishoras.modelo.Curso;
import org.sishoras.modelo.Disciplina;
import org.sishoras.modelo.Espelho;
import org.sishoras.modelo.Horario;
import org.sishoras.modelo.NivelPagamentoProfessor;
import org.sishoras.modelo.OcorrenciaDisciplina;
import org.sishoras.modelo.Professor;
import org.sishoras.modelo.Turma;

public class HibernateUtil {
	private static SessionFactory factory;
	static {
		AnnotationConfiguration configuration = new AnnotationConfiguration();
/*		configuration.addAnnotatedClass(Aula.class);
		configuration.addAnnotatedClass(Curso.class);
		configuration.addAnnotatedClass(Adiantamento.class);
		configuration.addAnnotatedClass(Disciplina.class);
		configuration.addAnnotatedClass(Espelho.class);
		configuration.addAnnotatedClass(Horario.class);
		configuration.addAnnotatedClass(NivelPagamentoProfessor.class);
		configuration.addAnnotatedClass(OcorrenciaDisciplina.class);
		configuration.addAnnotatedClass(Professor.class);
		configuration.addAnnotatedClass(Turma.class);
		
		configuration.addAnnotatedClass(Reserva.class);
*/
		configuration.configure();
		factory = configuration.buildSessionFactory();
	}
	public static Session getSession() {
		return factory.openSession();
	}
}
